package com.xsm.ppsecret.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Author: Xiasem
 * Email: xiasem@163.com
 * Date: 16-12-25.
 */

public class DBHelper extends SQLiteOpenHelper {

    private static final String TAG = "DBHelper";

    public static final String CREATE_TABLE_PWDS =
            "create table pwds (" +
                    "_id integer primary key autoincrement," +
                    "json text not null," +
                    "authority integer not null" +
                    ")";
    public static final String CREATE_TABLE_LOGS =
            "create table logs (" +
                    "_id integer primary key autoincrement," +
                    "json text not null," +
                    "authority integer not null" +
                    ")";

    public DBHelper(Context context) {
        super(context, "ppsdata", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL(CREATE_TABLE_PWDS);
        sqLiteDatabase.execSQL(CREATE_TABLE_LOGS);
        Log.d("DBHelper", "onCreate: 数据库表创建了");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
